package com.ef.service;

import java.util.Date;
import java.util.List;

import com.ef.constant.ETimeline;
import com.ef.domain.ClassEntity;
import com.ef.domain.Leads;
import com.ef.domain.LeadsClassEntity;
import com.ef.util.CustomExample;
import com.ef.util.PaginationSupport;

/**
 * leads的选课
 * 
 * @author CYG create:2009-12-22 下午11:24:53
 */
public interface LeadsClassEntityService extends BaseService {
	
	public LeadsClassEntity findById(Long id);
	
 	/**
	 * 获取选择该课的List.按booking 时间 升序排列<br/>
	 * 
	 * @param classEntity
	 * @return
	 */
	public List<LeadsClassEntity> getLeadsClassEntityListWithClassEntity(
			ClassEntity classEntity);

	public List<LeadsClassEntity> getLeadsClassEntityListWithClassEntityOrderByElitCard(
			ClassEntity classEntity);
			
	public List<LeadsClassEntity> getLeadsClassEntityList(Leads leads, int max);
	
	public List<LeadsClassEntity> getLeadsClassEntityListOrderByBookingTime(int year, int week,
			Leads leads);
	
	public List<LeadsClassEntity> getLeadsClassEntityListOrderByBookingTime(Leads leads,int num);
	
 	/**
	 * 是否已选课,包括cancel的
	 * 
	 * @param classEntityid
	 * @param leadsid
	 * @return
	 */
	public boolean leadsHasThisClassEntity(Long classEntityid, Long leadsid);

	public PaginationSupport<LeadsClassEntity> findByClassEntityId(
			Long entityId,boolean isWaiting,int startIndex, int pageSize);

	public PaginationSupport<LeadsClassEntity> findByDate(Date date,boolean isWaiting,
			int startIndex, int pageSize);

	public PaginationSupport<LeadsClassEntity> findByDateTime(Date date,
			ETimeline timeline,boolean isWaiting, int startIndex, int pageSize);

	public PaginationSupport<LeadsClassEntity> findByLeadIdBetweenDays(
			Long leadsId, Date fDate, Date lDate, int startIndex, int pageSize);

	public PaginationSupport<LeadsClassEntity> findByExample(
			CustomExample<LeadsClassEntity> example, int startIndex,
			int pageSize);
}
